package com.water.wfo.user.pojo.context;

import com.water.wfo.user.pojo.entity.IUser;

/**
 * packageName com.water.wfo.user.pojo.context
 *
 * @author
 * @className UserContext(处以class为网)
 * @date 2025/1/16
 * @description T0D0
 */
public final class UserContext {
    private static final ThreadLocal<IUser> USER_STORE = new ThreadLocal<>();

    private UserContext(){

    }

    public static IUser getCurrentUser(){
        return USER_STORE.get();
    }

    public static void setCurrentUser(IUser user){
        USER_STORE.set(user);
    }

    public static void remove(){
        USER_STORE.set(null);
    }
}
